﻿<UserControl x:Class="CloudStorageLight.WpfClient.UserPasswordWindow"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:properties="clr-namespace:CloudStorageLight.WpfClient.Properties"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:CloudStorageLight.WpfClient"
             mc:Ignorable="d" Loaded="UserControl_Loaded" >
    <UserControl.Resources>
        <local:BindingProxy x:Key="proxy" Data="{Binding}" />
        <Style TargetType="{x:Type Control}" x:Key="baseStyle">
            <Setter Property="FontSize" Value="{Binding Path=Data.FontSize, Source={StaticResource proxy}}" />
        </Style>
        <Style TargetType="TextBlock">
            <Setter Property="FontSize" Value="{Binding Path=Data.FontSize, Source={StaticResource proxy}}" />
        </Style>
    </UserControl.Resources>
    <Grid Height="150" Width="400">
        <ContentControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib" IsTabStop="False">
            <ContentControl.Resources>
                <ResourceDictionary>
                    <ResourceDictionary.MergedDictionaries>
                        <ResourceDictionary Source="/ViewMaker.Core;component/wpf/wpfgenericresource.xaml" />
                        <ResourceDictionary Source="/ViewMaker.Core;component/wpf/wpferrorstyleresource.xaml" />
                    </ResourceDictionary.MergedDictionaries>
                </ResourceDictionary>
            </ContentControl.Resources>
            <Grid Name="UserPasswordVM" DataContext="{Binding Mode=OneWay}">
                <StackPanel Name="UserPasswordVMDataPanel" Orientation="Vertical" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="0" Grid.Column="0">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Label Width="100" HorizontalContentAlignment="Left" VerticalAlignment="Center">
                            <TextBlock Text="{x:Static properties:Resources.MsgUser}" />
                        </Label>
                        <TextBox Name="User" FontSize="{Binding FontSize}" Text="{Binding Path=User, Mode=TwoWay, ValidatesOnExceptions=True, ValidatesOnDataErrors=True, NotifyOnValidationError=True }" VerticalAlignment="Center" Grid.Column="1" />
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Label Width="100" HorizontalContentAlignment="Left" VerticalAlignment="Center">
                            <TextBlock Text="{x:Static properties:Resources.MsgPassword}" />
                        </Label>
                        <PasswordBox Name="Password" FontSize="{Binding FontSize}" VerticalAlignment="Center" Grid.Column="1" />
                    </Grid>
                </StackPanel>
                <StackPanel Name="UserPasswordVMButtonPanel" Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0">
                    <Button Name="OK" Click="OK_Click" Margin="5">
                        <TextBlock Text="{x:Static properties:Resources.MsgLogin}" />
                    </Button>
                    <Button Name="Close" Command="{Binding Path=Close,Mode=OneWay}" Margin="5">
                        <TextBlock Text="{x:Static properties:Resources.MsgClose}" />
                    </Button>
                </StackPanel>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
            </Grid>
        </ContentControl>
    </Grid>
</UserControl>
